package com.woniu.controller;

import com.woniu.annotation.PreAuthorize;
import com.woniu.service.MenuService;
import com.woniu.util.ResponseEnum;
import com.woniu.util.ResponseUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/menu")
public class MenuController {
    @Resource
    private MenuService service;
    @GetMapping("/{userId}")
    public ResponseUtil findMenuById(@PathVariable Integer userId){
        ResponseUtil result = service.findMenuById(userId);
        return result;
    }
    @GetMapping("/user")
    @PreAuthorize(value = {"goodInfo11","goodAdd"})
    public ResponseUtil findUser(){
        return ResponseUtil.get(ResponseEnum.OK);
    }
}
